package com.api.core.config;

import org.springframework.boot.web.server.ConfigurableWebServerFactory;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

@Component
@Configuration
public class WebPageConfig {

	@Bean
	public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer(){
		return factory -> {
//			factory.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/bad_request"));
//			factory.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/internal_server_error"));
			factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/not_found"));
		};
	}

}
